package cn.jingzhuan.element.demo.view.fragment

import android.os.Bundle
import cn.jingzhuan.element.demo.view.BaseBindingFragment
import cn.jingzhuan.element.demo.view.activity.AlbumDetailActivity
import cn.jingzhuan.element.element.R
import cn.jingzhuan.element.element.databinding.FragmentAlbumIntroBinding

class AlbumIntroFragment : BaseBindingFragment<FragmentAlbumIntroBinding>(){
    override fun getLayoutId(): Int = R.layout.fragment_album_intro

    override fun onDataBind(savedInstanceState: Bundle?, binding: FragmentAlbumIntroBinding) {
        var activity = getBaseActivity()  as AlbumDetailActivity
        var audioAlbum = activity.audioAlbumItem
        binding.audioAlbum = audioAlbum

        // 更新中
        if (audioAlbum.status == 1) {
            binding.updateStatusValue.text = resources.getText(R.string.album_status_updating)
            binding.updateStatusValue.setTextColor(resources.getColor(R.color.skyblue,activity.theme))
        } else { // 已完结
            binding.updateStatusValue.text = resources.getText(R.string.album_status_done)
            binding.updateStatusValue.setTextColor(resources.getColor(R.color.gray,activity.theme))
            binding.updateStatusValue.isSelected = true

        }
    }

}